<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button onclick="tian()">添加</button>
    <script src="https://code.jquery.com/jquery-3.7.1.js"></script>
    <script>
        //渲染
        $.ajax({
            type: 'GET',
            url: 'https://result.eolink.com/NUPerrp561bd641f17dcca996d57132f30db1b99d775b77?uri=/goodsx/goodslist',
            data: {},
            dataType: "json",
            success: (b) => {
                console.log(b.data);
            },
            error: (e) => {
                console.log(e);
            }
        })
        //添加
        function tian() {
            $.ajax({
                type: 'POST',
                url: 'https://result.eolink.com/NUPerrp561bd641f17dcca996d57132f30db1b99d775b77?uri=/goodsx/add',
                data: {
                    goods_name: "chabei",
                    stock: '12',
                    price: '123',
                    status: '1',
                    sold: '已售',
                    img: '12321312',
                },
                dataType: "json",
                success: (a) => {
                    console.log(a);
                },
                error: (e) => {
                    console.log(e);
                }
            })
        }
    </script>
</body>

</html>